package com.cjf.smartrefresh.horizontal;

import android.graphics.Canvas;
import android.graphics.Rect;
import android.support.annotation.NonNull;

import com.scwang.smart.refresh.classics.ArrowDrawable;

/**
 * 用于横向刷新的箭头---经典刷新头、经典尾
 * @author cjf
 * @date 2021/3/4
 */
public class ArrowDrawableHorizontal extends ArrowDrawable {
    @Override
    public void draw(@NonNull Canvas canvas) {
        canvas.save();
        final Rect bounds = this.getBounds();
        final int width = bounds.width();
        final int height = bounds.height();
        canvas.rotate(-90, width / 2.0f, height / 2.0f);
        super.draw(canvas);
        canvas.restore();
    }
}
